package com.julu.o2o.util;

import java.lang.reflect.Field;

import org.apache.commons.beanutils.PropertyUtilsBean;

public class PropertyUtils {
	private static PropertyUtilsBean bean;
	
	public static PropertyUtilsBean getPropertyUtils(){
		if(bean == null){
			bean = new PropertyUtilsBean(); 
		}		
		return bean;
	}	
	
    public static void copyProperty(Object bean, String name, Object value){
    	try{
    		Field f1 = bean.getClass().getField(name);
    		f1.setAccessible(true);
    		f1.set(bean, value);
    	}catch(Exception e){
    		
    	}
    	
    }
}
